package com.health.security;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.health.report.ReportForm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: zipeng Li
 * 2021/6/20  15:45
 */
@Mapper
public interface ReportFormMapper extends BaseMapper<ReportForm> {
    @Select("select * from report_form where create_time >= date(now()) and create_time < DATE_ADD(date(now()),INTERVAL 1 DAY) and central_authentication_id=#{id}")
    ReportForm getDayRecord(@Param("id") Long id);

    @Select("select * from report_form where create_time >= date(now()) and create_time < DATE_ADD(date(now()),INTERVAL 1 DAY)")
    List<ReportForm> getDayRecords();

    @Select("select * from report_form where is_reach_key_area=1 or is_touch_danger_person=1 and create_time >= date(now()) and create_time < DATE_ADD(date(now()),INTERVAL 1 DAY)")
    List<ReportForm> getDangerNumber();
}